package com.crr.controller;

import com.crr.bean.Order;
import com.crr.bean.ResultBean;
import com.crr.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "订单管理")
@RestController
@RequestMapping("/api/order")
public class OrderController extends BaseController {
    @Autowired
    OrderService orderService;

    @ApiOperation("保存订单")
    @PostMapping("/save")
    public ResultBean save(@RequestBody Order order) {
        int i = orderService.saveEntity(order);
        return saveResult(i);
    }
}
